home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / wics.zip / IBUTTON.CPP < prev    next >
C/C++ Source or Header  |  1993-03-03  |  2KB  |  54 lines

  1. //==============================================================================================
  2. //
  3. //    Windows Interface Construction Set
  4. //    Version 1.00
  5. //
  6. //    IBUTTON.CPP - Icon Bar Button Class
  7. //    Copyright ⌐ 1993 by Microdyne Development Technologies
  8. //    All rights reserved.
  9. //==============================================================================================
  10.  
  11. //----------------------------------------------------------------------------------------------
  12. //    Note:    Applications that use this class must load the WICS.DLL before using this class.
  13. //            The WICS.CLL will create and register the WICSButton class that is necessary for
  14. //            this class to work properly.
  15. //----------------------------------------------------------------------------------------------
  16.  
  17. #include <ibutton.h>
  18. #include <wics.h>
  19.  
  20. //----------------------------------------------------------------------------------------------
  21. //    Constructor for a TIconBarButton object. Initializes its data fields using supplied
  22. //    parameters and default values.
  23. //----------------------------------------------------------------------------------------------
  24.  
  25. TIconBarButton::TIconBarButton(PTWindowsObject AParent, int AnId, int X, int Y, BOOL fState, PTModule AModule)
  26.                       : TButton(AParent, AnId, NULL, X, Y, 0, 0, FALSE, AModule)
  27. {
  28.     Attr.Style = WS_CHILD | WS_VISIBLE | WBS_ICONBUTTON ;
  29.     Attr.W = 20;
  30.     Attr.H = 20;
  31.  
  32.     if ( fState )
  33.         Attr.Style |= WBS_STATEBUTTON ;
  34. }
  35.  
  36. //----------------------------------------------------------------------------------------------
  37. //    Constructor for a TIconBarButton to be associated with a MS-Windows interface element
  38. //    created by MS-Windows from a resource definition. Initializes its data fields using
  39. //    supplied parameters.
  40. //----------------------------------------------------------------------------------------------
  41.  
  42. TIconBarButton::TIconBarButton(PTWindowsObject AParent, int ResourceId, PTModule AModule)
  43.                  : TButton(AParent, ResourceId, AModule)
  44. {
  45.     Attr.Style = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | 0x800 ;
  46. }
  47.  
  48. PTStreamable TIconBarButton::build()
  49. {
  50.     return new TIconBarButton(streamableInit);
  51. }
  52.  
  53. TStreamableClass RegBButton("TIconBarButton", TIconBarButton::build, __DELTA(TIconBarButton));
  54.